
	Ext.namespace("panel.widgets.chunks.stubs");

	panel.widgets.chunks.stubs.onAjaxFailure = function(jopa, popa, r) {
		
		if( r.responseText != undefined && r.responseText ) {
			
			var message = r.responseText;
		
			try {
				
				var err = Ext.util.JSON.decode(r.responseText);
				message = err.error.message;
				
			} catch( e ) { }
			
			panel.console.log("AJAX ERROR", message);
		
			Ext.MessageBox.show({
			
				title: "Ajax Error",
				
				msg: [
						
					"<div class='w_max h_300 fnt_mono' style='overflow-y: scroll;'>",
					message.replace("\n", "<br>"), 
					"</div>"
				
				].join(""),						
				
				buttons : Ext.MessageBox.OK,
				icon    : Ext.MessageBox.ERROR,
				modal   : true,
				
				fn: function() {
					
					if( r.status == 403 ) {
						window.location.href = "/"; }
					
				}
				
			});
											
		}
			
	}	// function